use super::handlers::*;
use actix_web::web;
//健康检查
pub fn general_routes(cfg: &mut web::ServiceConfig){
    cfg.route("health",web::get().to(health_check_handler));
}

//获取产品信息
pub fn product_routes(cfg: &mut web::ServiceConfig){
    cfg
    .service(
        web::scope("/product")
        .route("/",web::get().to(products))
        .route("/new", web::post().to(new_product))
        .route("/new/1", web::get().to(get_all_product_with_id))
    );
    //.route("/product", web::post().to(new_product))
    //.route("/{product_id}",web::get().to(get_all_product_with_id));
}